import Base from './Base'
import Page from './Page'
class ProductAttachmentType extends Base {
  constructor ({
    id = '',
    name = '',
    sort = ''
  }) {
    super({id})

    this.name = name
    this.sort = sort
  }
  // 获取列表
  static async find (params) {
    let {content, ...pagination} = await ProductAttachmentType.$http.get(`${this.$name}/list`, {params})
    content = content.map(v => new this(v))
    content.forEach(v => { v.id = parseInt(v.id) })
    pagination = new Page(pagination)
    return {content, pagination}
  }
}
// 静态属性
ProductAttachmentType.$name = '/product/attachement/type'
export default ProductAttachmentType
